Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distribute framework: restrict the task state transform rule #45932

Merged
merged 12 commits into from
Aug 18, 2023

Conversation

GMHDBJD
Copy link
Contributor

@GMHDBJD GMHDBJD commented Aug 9, 2023

What problem does this PR solve?

Issue Number: ref #41495

Problem Summary:

What is changed and how it works?

restrict the task state transform rule

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 9, 2023
@tiprow
Copy link

tiprow bot commented Aug 9, 2023

Hi @GMHDBJD. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@codecov
Copy link

codecov bot commented Aug 9, 2023

Codecov Report

Merging #45932 (5b7c9fe) into master (772275c) will decrease coverage by 2.7972%.
Report is 76 commits behind head on master.
The diff coverage is 87.3015%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #45932        +/-   ##
================================================
- Coverage   74.7799%   71.9828%   -2.7972%     
================================================
  Files          1293       1308        +15     
  Lines        397910     412340     +14430     
================================================
- Hits         297557     296814       -743     
- Misses        80985      96717     +15732     
+ Partials      19368      18809       -559     
Flag Coverage Δ
integration 27.1171% <0.0000%> (-19.3716%) ⬇️
unit 73.3625% <94.8275%> (+0.0205%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 54.0444% <ø> (ø)
parser 85.0656% <ø> (+0.0054%) ⬆️
br 47.2296% <ø> (-17.4618%) ⬇️

@ywqzzy
Copy link
Contributor

ywqzzy commented Aug 9, 2023

/cc @ywqzzy

@ti-chi-bot ti-chi-bot bot requested a review from ywqzzy August 9, 2023 08:01
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 9, 2023
@GMHDBJD
Copy link
Contributor Author

GMHDBJD commented Aug 9, 2023

/retest

@tiprow
Copy link

tiprow bot commented Aug 9, 2023

@GMHDBJD: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@GMHDBJD
Copy link
Contributor Author

GMHDBJD commented Aug 10, 2023

/retest

@tiprow
Copy link

tiprow bot commented Aug 10, 2023

@GMHDBJD: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@GMHDBJD
Copy link
Contributor Author

GMHDBJD commented Aug 10, 2023

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Aug 10, 2023
if !VerifyTaskStateTransform(prevState, taskState) {
return errors.Errorf("invalid task state transform, from %s to %s", prevState, taskState)
}
failpoint.Inject("syncInUpdateTask", func(_ failpoint.Value) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems not used.

@@ -41,6 +41,7 @@ const (
TaskStateCanceled = "canceled"
TaskStatePausing = "pausing"
TaskStatePaused = "paused"
TaskStateResuming = "resuming"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need more discussion to introduce a new state.
For now, LGTM.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Further more, we can distinguish subtask state and task state later.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 11, 2023

@ywqzzy: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ti-chi-bot ti-chi-bot bot added the approved label Aug 17, 2023
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Aug 17, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 17, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tangenta, wjhuang2016, ywqzzy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [tangenta,wjhuang2016]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 17, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 17, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-08-17 08:43:47.361154913 +0000 UTC m=+793391.910170900: ☑️ agreed by wjhuang2016.
  • 2023-08-17 08:47:29.410069969 +0000 UTC m=+793613.959085956: ☑️ agreed by tangenta.

@GMHDBJD
Copy link
Contributor Author

GMHDBJD commented Aug 17, 2023

/merge

@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 17, 2023

@GMHDBJD: We have migrated to builtin LGTM and approve plugins for reviewing.

Please use /approve when you want approve this pull request.

The changes announcement: LGTM plugin changes

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@GMHDBJD
Copy link
Contributor Author

GMHDBJD commented Aug 18, 2023

/retest

@ti-chi-bot ti-chi-bot bot merged commit 883e88a into pingcap:master Aug 18, 2023
4 of 9 checks passed
_, err := ExecSQL(stm.ctx, se, "update mysql.tidb_global_task set state = %?, dispatcher_id = %?, step = %?, state_update_time = %?, concurrency = %?, meta = %?, error = %? where id = %?",
gTask.State, gTask.DispatcherID, gTask.Step, gTask.StateUpdateTime.UTC().String(), gTask.Concurrency, gTask.Meta, serializeErr(gTask.Error), gTask.ID)
_, err := ExecSQL(stm.ctx, se, "update mysql.tidb_global_task set state = %?, dispatcher_id = %?, step = %?, state_update_time = %?, concurrency = %?, meta = %?, error = %? where id = %? and state = %?",
gTask.State, gTask.DispatcherID, gTask.Step, gTask.StateUpdateTime.UTC().String(), gTask.Concurrency, gTask.Meta, serializeErr(gTask.Error), gTask.ID, prevState)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need check how many lines're affected, if 0, we shouldn't update subtasks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need check how many lines're affected, if 0, we shouldn't update subtasks

I will fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants